package com.zq.repository;

import com.zq.entity.Tag;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author:任人渐疏
 * @Date:Created in 12:08 下午 2020/6/27
 * Update:true
 */
public interface TagRepository extends JpaRepository<Tag,Integer>, JpaSpecificationExecutor<Tag> {

    @Query(nativeQuery = true,value = "select * from tag where tagname=?1")
    Tag findByTagName(String tagName);

     @Query(nativeQuery = true,value = "select * from `tag` ")
    List<Tag> getAllTag();
}
